1 //-------------------------------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // This module provides wrappers that simulate unicode API's on Win95.
7 //-------------------------------------------------------------------------------------------------
11 /*****************************************************************************/
12 // @@ fullwidth/halfwidth conversion macros
14 // MAKEFULLWIDTH - Converts a half-width to full-width character
16 #define MAKEFULLWIDTH(c) (((c) < 0x0021 || (c) > 0x007E) ? (c) : ((c) + 0xFF00 - 0x0020))
18 // MAKEHALFWIDTH - Converts a full-width character to half-width
19 #define MAKEHALFWIDTH(c) (((c) < 0xFF01 || (c) > 0xFF5E) ? (c) : ((c) - 0xFF00 + 0x0020))
21 // ISFULLWIDTH - Returns if the character is full width
22 #define ISFULLWIDTH(c) ((c) > 0xFF00 && (c) < 0xFF5F)
26 /*****************************************************************************/
27 // @@ Unicode/Ansi string conversion functions
28 // - WIDESTR(sz) - converts an ANSI string to unicode on the stack
29 // - ANSISTR(wsz) - converts a unicode string to ANSI on the stack
30 // - WszCpyToSz(sz, wsz) - copy a unicode string into an ansi buffer
31 // - SzCpyToWsz(wsz, sz) - copy an ANSI string to unicode buffer
32 // Be care of using the WIDESTR and ANSISTR macros inside of a loop, since
33 // each invocation causes stack allocation. If you need to perform
34 // ANSI / Unicode version within a loop, use WszCpyToSz or SzCpyToWsz
37 _Out_z_cap_x_(strlen(wszSrc
)+ 1)char * szDest
,
38 _In_z_
const WCHAR
* wszSrc
);
41 _Out_z_cap_x_((strlen(szSrc
)+ 1)* sizeof(WCHAR
))WCHAR
* wszDest
,
42 _In_z_
const char * szSrc
);
46 /*****************************************************************************/
47 // @@ Unicode string compare functions.
48 // - WszEqNoCase - case insensitive, default lcid, compare entire string
49 // - WszEqLenNoCase - case insensitive, default lcid,
52 _In_z_
const WCHAR
* wsz1
,
53 _In_z_
const WCHAR
* wsz2
);
56 _In_count_(cch
)const WCHAR
* wsz1
,
58 _In_z_
const WCHAR
* wsz2
);
60 /*****************************************************************************/
61 // @@ Unicode string conversion functions.
62 // - BinaryToUnicode - converts binary stream into hex-encoded string
67 _Out_z_cap_x_(" At least cbSrc ")LPWSTR pwszDst
);